import { baseUrl, Get } from '../../server'

const severName = 'hr/web' // 服务前缀名
const newBaseUrl = baseUrl + severName

/***************** 全球人力接口---人效、元效 蔚文杰***********************/
/**
 * 查询人效趋势（年）（区域）
 * http://yapi.tiens.com/project/550/interface/api/35115
 *
 */
const getHumanEffect: any = () => {
  const url = `${newBaseUrl}/api/humanEffect/getTrend?humanEffectType=1`
  return Get(url)
}
/**
 * 查询元效趋势（年）（区域）
 * http://yapi.tiens.com/project/550/interface/api/35115
 *
 */
const getMetaeffect: any = () => {
  const url = `${newBaseUrl}/api/humanEffect/getTrend?humanEffectType=2`
  return Get(url)
}
/**
 * 查询人效各国对比（年月）（区域）
 * http://yapi.tiens.com/project/550/interface/api/35119
 *
 */
const getComparisonHumanEffect: any = () => {
  const url = `${newBaseUrl}/api/humanEffect/getCompare?humanEffectType=1`
  return Get(url)
}
/**
 * 查询元效各国对比（年月）（区域）
 * http://yapi.tiens.com/project/550/interface/api/35119
 *
 */
const getComparisonMetaeffect: any = () => {
  const url = `${newBaseUrl}/api/humanEffect/getCompare?humanEffectType=2`
  return Get(url)
}
/********************* 张华  *****************************/
/**
 * 人员结构
 * http://yapi.tiens.com/project/550/interface/api/35131
 *
 */
const getHumanStructure: any = () => {
  const url = `${newBaseUrl}/api/human/structure`
  return Get(url)
}
/********************* 吕金倩  入职离职  *****************************/
/**
 * 入职分析
 * http://yapi.tiens.com/project/550/interface/api/35135
 *
 */
const getEntryAnalysis: any = () => {
  const url = `${newBaseUrl}/employee/getEntryAnalysis`
  return Get(url)
}
/**
 * 离职分析
 * http://yapi.tiens.com/project/550/interface/api/35135
 *
 */
const getDepartureAnalysis: any = () => {
  const url = `${newBaseUrl}/employee/getDepartureAnalysis`
  return Get(url)
}
/**
 * 入职人数比对
 * http://yapi.tiens.com/project/550/interface/api/35151
 *
 */
const getEnterComparison: any = () => {
  const url = `${newBaseUrl}/employee/getEnterComparison`
  return Get(url)
}
/**
 * 离职人数比对
 * http://yapi.tiens.com/project/550/interface/api/35155
 *
 */
const getDepartureComparison: any = () => {
  const url = `${newBaseUrl}/employee/getDepartureComparison`
  return Get(url)
}
/**
 * 人员流动率
 * http://yapi.tiens.com/project/550/interface/api/35159
 *
 */
const getEmployeeTurnoverRate: any = () => {
  const url = `${newBaseUrl}/employee/getEmployeeTurnoverRate`
  return Get(url)
}
/************************* 谷守丙  全球人力接口-- 绩效，人工成本，雇员**************************************/
/**
 * 全球各区雇员人数趋势，{???}各国雇员人数趋势，{???}雇员人数趋势
 * http://yapi.tiens.com/project/550/interface/api/35167
 *
 */
const getEmployeeNumber: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getEmployeeLcP?paramType=1`
  return Get(url)
}
/**
 * 全球各区域人工成本总额趋势
 * http://yapi.tiens.com/project/550/interface/api/35167
 *
 */
const getLaborCosts: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getEmployeeLcP?paramType=2`
  return Get(url)
}
/**
 * {???}各国人工成本比对，
 * http://yapi.tiens.com/project/550/interface/api/35167
 *
 */
const getLaborCostsContrast: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getlaborCostPerformance?paramType=2`
  return Get(url)
}
/**
 * 全球各区绩效结果，(区域)全年绩效，(职能部门)全年绩效
 * http://yapi.tiens.com/project/550/interface/api/35167
 *
 */
const getPerformance: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getlaborCostPerformance?paramType=3`
  return Get(url)
}
/**
 * 月度 柱状图 (全球各区,{???}各国雇员,各子部门,集团总部各总部)雇员人数比对;
 * http://yapi.tiens.com/project/550/interface/api/35175
 *
 */
const getPerformanceContrast: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getEmployeeLcPMonth?paramType=1`
  return Get(url)
}
/**
 * 月度 柱状图 (全球各区,{???}各国雇员,各子部门,集团总部各总部)人工成本;
 * http://yapi.tiens.com/project/550/interface/api/35175
 *
 */
const getComparisonLaborCosts: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getEmployeeLcPMonth?paramType=2`
  return Get(url)
}
/**
 * 年度 柱折图 (区域,集团总部,二级部门)人工成本总额趋势
 * http://yapi.tiens.com/project/550/interface/api/35179
 *
 */
const getEmployeeLcPYear: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getEmployeeLcPYear`
  return Get(url)
}
/**
 * 月度 --饼图 (集团总部,二级部门) 各部门成本占比
 * http://yapi.tiens.com/project/550/interface/api/35183
 *
 */
const getDepartmentalCostsPie: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getDepartmentalCostsPie`
  return Get(url)
}
/**
 * 年度，月度 --全球,区域,职能部门
 * http://yapi.tiens.com/project/550/interface/api/35187
 *
 */
const gethomepagedata: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/gethomepagedata`
  return Get(url)
}
/**
 * 月度 --表格 全球绩效分布
 * http://yapi.tiens.com/project/550/interface/api/35191
 *
 */
const getGlobalPerformanceMonth: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getGlobalPerformanceMonth`
  return Get(url)
}
/**
 * 获取部门列表
 * http://yapi.tiens.com/project/550/interface/api/35195
 *
 */
export const getDepartmentList: any = () => {
  const url = `${newBaseUrl}/dim/getDepartmentList`
  return Get(url)
}
//http://yapi.tiens.com/project/550/interface/api/35555
//回款率趋势
const getCollectionRate: any = () => {
  const url = `${newBaseUrl}/api/humanEffect/getCollectionRate`
  return Get(url)
}

//http://yapi.tiens.com/project/550/interface/api/35563
//营收、利润同比增长情况（全球年、区域年、全球月、区域月
const getPerformancedRevenueProfit: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getPerformancedRevenueProfit?typeTable=1`
  return Get(url)
}
const getPerformancedRevenueProfitMonth: any = () => {
  const url = `${newBaseUrl}/api/EmployeeLcP/getPerformancedRevenueProfit?typeTable=2`
  return Get(url)
}
//http://yapi.tiens.com/project/550/interface/api/35551
//分类对比指标（全球月、区域年、区域年）（叠状、柱状图）
const getDpCategoryCompare: any = () => {
  const url = `${newBaseUrl}/api/humanEffect/getDpCategoryCompare`
  return Get(url)
}
//http://yapi.tiens.com/project/550/interface/api/35587
//经营类、运营类指标（全球年） （多柱）
const getPerformanceMetrics: any = () => {
  const url = `${newBaseUrl}/api/performance/getPerformanceMetrics?typeTable=1`
  return Get(url)
}
//http://yapi.tiens.com/project/550/interface/api/35587
//经营类、运营类指标（全球年） （多柱）
const getPerformanceMet: any = () => {
  const url = `${newBaseUrl}/api/performance/getPerformanceMetrics?typeTable=2`
  return Get(url)
}
export const humanApi: any = {
  // 全球人力接口---人效、元效 蔚文杰*
  getHumanEffect,
  getMetaeffect,
  getComparisonHumanEffect,
  getComparisonMetaeffect,
  getCollectionRate,
  getDpCategoryCompare,

  // 张华
  getHumanStructure,
  // 吕金倩
  getEntryAnalysis,
  getDepartureAnalysis,
  getEnterComparison,
  getDepartureComparison,
  getEmployeeTurnoverRate,
  // 谷守丙
  getEmployeeNumber,
  getLaborCosts,
  getLaborCostsContrast,
  getPerformance,
  getPerformanceContrast,
  getComparisonLaborCosts,
  getEmployeeLcPYear,
  getDepartmentalCostsPie,
  gethomepagedata,
  getGlobalPerformanceMonth,
  getPerformancedRevenueProfit,
  getPerformancedRevenueProfitMonth,

  //王琰超
  getPerformanceMetrics,
  getPerformanceMet
}
